<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="${pageContext.request.contextPath}/js/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
    <script type="application/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.js"></script>
    <script type="application/javascript" src="${pageContext.request.contextPath}/js/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <script type="application/javascript">
       $(function () {
           $("#addBtn").click(function () {
               window.location.href="${pageContext.request.contextPath}/user/toAddUser";
           });
       });
    </script>
</head>
<body>
<button type="button" class="btn btn-info" id="addBtn">添加</button>&nbsp;
<button type="button" class="btn btn-sm btn-warning">删除</button>&nbsp;
<button type="button" class="btn btn-default">修改</button>&nbsp;
<button type="button" class="btn btn-default">查看</button>&nbsp;
<br/>

<table class="table" border="1" style="border-collapse:collapse;">
    <thead>
        <tr>
            <th>用户ID</th><th>姓名</th><th>年龄</th>
        </tr>
    </thead>
    <tbody>
    <c:forEach items="${userList}" var="user">
        <tr>
            <td>${user.id}</td><td>${user.name}</td><td>${user.age}</td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<display:table name="userList" pagesize="10" id="element" requestURI="Page" partialList="true"
               size="resultSize">:

    <display:column property="id" title="ID" sortable="true" ></display:column>
    <display:column property="toId" ></display:column>
    <display:column property="content" ></display:column>
    <display:column property="Id" ></display:column>
    <display:column property="posttime" ></display:column>
</display:table>
</body>
</html>
